#ifndef PSIFACTORY_H
#define PSIFACTORY_H

#include "PSI1D_SEE.h"
#include "PSI1D_Sputtering.h"
#include "PSI1D_RefDep.h"
#include "PSI1D_Recycling.h"


#include <string>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <ostream>
#include <sstream>
using namespace std;

class PSIFactory {

public:

    static vector<PSI*> create(PicParams* params_, ParallelMPI* pmpi_, vector<Species*>* vecSpecies_)
	{
	    vector<PSI*> vecPSI;

        for (int i_psi = 0; i_psi < params_->psi_param.size(); i_psi++)
		{
            auto psi_param_ = params_->psi_param[i_psi];

            if(params_->geometry == "1d3v" && psi_param_.psi_type == "Sputtering")
			{
                vecPSI.push_back( new PSI1D_Sputtering(params_, pmpi_, vecSpecies_, psi_param_, i_psi) );
			}

            else if(params_->geometry == "1d3v" && psi_param_.psi_type == "RefDep")
			{
                vecPSI.push_back( new PSI1D_RefDep(params_, pmpi_, vecSpecies_, psi_param_, i_psi) );
			}

            else if(params_->geometry == "1d3v" && psi_param_.psi_type == "Recycling")
            {
                vecPSI.push_back( new PSI1D_Recycling(params_, pmpi_, vecSpecies_, psi_param_, i_psi) );
			}

            else if(params_->geometry == "1d3v" && psi_param_.psi_type == "SEE")
			{
                vecPSI.push_back( new PSI1D_SEE(params_, pmpi_, vecSpecies_, psi_param_, i_psi) );
			}

            else
            {
                log_error<<"no psi_param_.psi_type match: "<<psi_param_.psi_type;
			}
	    }

	    return vecPSI;
	};

};

#endif
